# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=wondershaper
pkgver=48.98792b5
pkgrel=1
pkgdesc='Limit the bandwidth of one or more network adapters.'
groups=('blackarch' 'blackarch-networking')
arch=('any')
url='https://github.com/magnific0/wondershaper'
license=('GPL2')
depends=('iproute' 'kmod')
makedepends=('git')
backup=('etc/conf.d/wondershaper.conf')
source=("git+https://github.com/magnific0/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

package() {
  cd $pkgname

  install -Dm 755 $pkgname "$pkgdir/usr/bin/wondershaper"
  install -Dm 644 "$pkgname.service" \
    "$pkgdir/usr/lib/systemd/system/$pkgname.service"
  install -Dm 644 "$pkgname.conf" "$pkgdir/etc/conf.d/$pkgname.conf"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.* ChangeLog \
    VERSION
  install -Dm 644 COPYING "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

